home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIP Haziran 2001.iso / prog / share / 17 / dings_e.exe / Compiler / Include / DX7 / dmdls.h < prev    next >
C/C++ Source or Header  |  1999-04-24  |  7KB  |  178 lines

  1. /************************************************************************
  2. *                                                                       *
  3. *   dmdls.h -- DLS download definitions for DirectMusic API's           *
  4. *                                                                       *
  5. *   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
  6. *                                                                       *
  7. ************************************************************************/
  8.  
  9. #ifndef _DMDLS_
  10. #define _DMDLS_
  11.  
  12. #include "dls1.h"
  13.  
  14. typedef long PCENT;     /* Pitch cents */
  15. typedef long GCENT;     /* Gain cents */
  16. typedef long TCENT;     /* Time cents */
  17. typedef long PERCENT;   /* Per.. cent! */
  18.  
  19. typedef LONGLONG REFERENCE_TIME;
  20. typedef REFERENCE_TIME *LPREFERENCE_TIME;
  21.  
  22. #ifndef MAKE_FOURCC
  23. #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
  24.                 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |   \
  25.                 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  26.  
  27.  
  28. typedef DWORD           FOURCC;         /* a four character code */
  29. #endif
  30.  
  31. typedef struct _DMUS_DOWNLOADINFO
  32. {
  33.     DWORD dwDLType;                     /* Instrument or Wave */
  34.     DWORD dwDLId;                       /* Unique identifier to tag this download. */
  35.     DWORD dwNumOffsetTableEntries;      /* Number of index in the offset address table. */
  36.     DWORD cbSize;                       /* Total size of this memory chunk. */
  37. } DMUS_DOWNLOADINFO;
  38.  
  39. #define DMUS_DOWNLOADINFO_INSTRUMENT    1
  40. #define DMUS_DOWNLOADINFO_WAVE          2
  41. #define DMUS_DOWNLOADINFO_INSTRUMENT2   3   /* New version for better DLS2 support. */
  42.  
  43. #define DMUS_DEFAULT_SIZE_OFFSETTABLE   1
  44.  
  45. /* Flags for DMUS_INSTRUMENT's ulFlags member */
  46.  
  47. #define DMUS_INSTRUMENT_GM_INSTRUMENT   (1 << 0)
  48.  
  49. typedef struct _DMUS_OFFSETTABLE
  50. {
  51.     ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
  52. } DMUS_OFFSETTABLE;
  53.  
  54. typedef struct _DMUS_INSTRUMENT
  55. {
  56.     ULONG           ulPatch;
  57.     ULONG           ulFirstRegionIdx;             
  58.     ULONG           ulGlobalArtIdx;         /* If zero the instrument does not have an articulation */
  59.     ULONG           ulFirstExtCkIdx;        /* If zero no 3rd party entenstion chunks associated with the instrument */
  60.     ULONG           ulCopyrightIdx;         /* If zero no Copyright information associated with the instrument */
  61.     ULONG           ulFlags;                        
  62. } DMUS_INSTRUMENT;
  63.  
  64. typedef struct _DMUS_REGION
  65. {
  66.     RGNRANGE        RangeKey;
  67.     RGNRANGE        RangeVelocity;
  68.     USHORT          fusOptions;
  69.     USHORT          usKeyGroup;
  70.     ULONG           ulRegionArtIdx;         /* If zero the region does not have an articulation */
  71.     ULONG           ulNextRegionIdx;        /* If zero no more regions */
  72.     ULONG           ulFirstExtCkIdx;        /* If zero no 3rd party entenstion chunks associated with the region */
  73.     WAVELINK        WaveLink;
  74.     WSMPL           WSMP;                   /*  If WSMP.cSampleLoops > 1 then a WLOOP is included */
  75.     WLOOP           WLOOP[1];
  76. } DMUS_REGION;
  77.  
  78. typedef struct _DMUS_LFOPARAMS
  79. {
  80.     PCENT       pcFrequency;
  81.     TCENT       tcDelay;
  82.     GCENT       gcVolumeScale;
  83.     PCENT       pcPitchScale;
  84.     GCENT       gcMWToVolume;
  85.     PCENT       pcMWToPitch;
  86. } DMUS_LFOPARAMS;
  87.  
  88. typedef struct _DMUS_VEGPARAMS
  89. {
  90.     TCENT       tcAttack;
  91.     TCENT       tcDecay;
  92.     PERCENT     ptSustain;
  93.     TCENT       tcRelease;
  94.     TCENT       tcVel2Attack;
  95.     TCENT       tcKey2Decay;
  96. } DMUS_VEGPARAMS;
  97.  
  98. typedef struct _DMUS_PEGPARAMS
  99. {
  100.     TCENT       tcAttack;
  101.     TCENT       tcDecay;
  102.     PERCENT     ptSustain;
  103.     TCENT       tcRelease;
  104.     TCENT       tcVel2Attack;
  105.     TCENT       tcKey2Decay;
  106.     PCENT       pcRange;
  107. } DMUS_PEGPARAMS;
  108.  
  109. typedef struct _DMUS_MSCPARAMS
  110. {
  111.     PERCENT     ptDefaultPan;
  112. } DMUS_MSCPARAMS;
  113.  
  114. typedef struct _DMUS_ARTICPARAMS
  115. {
  116.     DMUS_LFOPARAMS   LFO;
  117.     DMUS_VEGPARAMS   VolEG;
  118.     DMUS_PEGPARAMS   PitchEG;
  119.     DMUS_MSCPARAMS   Misc;
  120. } DMUS_ARTICPARAMS;
  121.  
  122. typedef struct _DMUS_ARTICULATION           /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. */
  123. {
  124.     ULONG           ulArt1Idx;              /* DLS Level 1 articulation chunk */
  125.     ULONG           ulFirstExtCkIdx;        /* 3rd party extenstion chunks associated with the articulation */
  126. } DMUS_ARTICULATION;
  127.  
  128. typedef struct _DMUS_ARTICULATION2          /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. */
  129. {
  130.     ULONG           ulArtIdx;               /* DLS Level 1/2 articulation chunk */
  131.     ULONG           ulFirstExtCkIdx;        /* 3rd party extenstion chunks associated with the articulation */
  132.     ULONG           ulNextArtIdx;           /* Additional articulation chunks */
  133. } DMUS_ARTICULATION2;
  134.  
  135. #define DMUS_MIN_DATA_SIZE 4       
  136. /*  The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK */
  137.  
  138. typedef struct _DMUS_EXTENSIONCHUNK
  139. {
  140.     ULONG           cbSize;                      /*  Size of extension chunk  */
  141.     ULONG           ulNextExtCkIdx;              /*  If zero no more 3rd party entenstion chunks */
  142.     FOURCC          ExtCkID;                                      
  143.     BYTE            byExtCk[DMUS_MIN_DATA_SIZE]; /*  The actual number that follows is determined by cbSize */
  144. } DMUS_EXTENSIONCHUNK;
  145.  
  146. /*  The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */
  147.  
  148. typedef struct _DMUS_COPYRIGHT
  149. {
  150.     ULONG           cbSize;                             /*  Size of copyright information */
  151.     BYTE            byCopyright[DMUS_MIN_DATA_SIZE];    /*  The actual number that follows is determined by cbSize */
  152. } DMUS_COPYRIGHT;
  153.  
  154. typedef struct _DMUS_WAVEDATA
  155. {
  156.     ULONG           cbSize;
  157.     BYTE            byData[DMUS_MIN_DATA_SIZE]; 
  158. } DMUS_WAVEDATA;
  159.  
  160. typedef struct _DMUS_WAVE
  161. {
  162.     ULONG           ulFirstExtCkIdx;    /* If zero no 3rd party entenstion chunks associated with the wave */
  163.     ULONG           ulCopyrightIdx;     /* If zero no Copyright information associated with the wave */
  164.     ULONG           ulWaveDataIdx;      /* Location of actual wave data. */
  165.     WAVEFORMATEX    WaveformatEx;       
  166. } DMUS_WAVE;
  167.  
  168. typedef struct _DMUS_NOTERANGE *LPDMUS_NOTERANGE;
  169. typedef struct _DMUS_NOTERANGE
  170. {
  171.     DWORD           dwLowNote;  /* Sets the low note for the range of MIDI note events to which the instrument responds.*/
  172.     DWORD           dwHighNote; /* Sets the high note for the range of MIDI note events to which the instrument responds.*/
  173. } DMUS_NOTERANGE;
  174.  
  175. #endif 
  176.  
  177.  
  178.